package com.ruoyi.central.domain;

import com.ruoyi.common.enums.common.State;
import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.validation.group.InsertGroup;
import com.ruoyi.common.validation.group.UpdateGroup;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Length;
import javax.validation.constraints.NotNull;
import com.ruoyi.common.core.domain.BaseEntity;

import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * 产品批次关联对象 top_central_product_type_material
 *
 * @author SunLuQuan
 * @date 2022-04-17
 */
@Data
@TableName("top_central_product_type_material")
public class TopCentralProductTypeMaterial extends BaseEntity{

private static final long serialVersionUID = 1L;

    public TopCentralProductTypeMaterial(String batchNo, Integer productTypeId) {
        this.batchNo = batchNo;
        this.productTypeId = productTypeId;
    }

    public TopCentralProductTypeMaterial() {
    }

    /** 产品批次号 */
    @TableId
    @Length(min = 0,max = 50,message="产品批次号 数据长度不能大于 50")
    private String batchNo;

    /** 产品类型 */
    @Excel(name = "产品类型")
    @NotNull(groups = {InsertGroup.class,UpdateGroup.class},message = "产品类型不能为空")
    @Length(min = 0,max = 10,message="产品类型 数据长度不能大于 10")
    private Integer productTypeId;

    //TODO 将字段加入到数据库中
    @TableField(exist = false)
    /**工艺编号*/
    private Integer artProcessId;

    /**表中没有的字段*/
    @TableField(exist = false)
    private Integer weight;

    @TableField(exist = false)
    private Date updateTime;

    @TableField(exist = false)
    private State state;

    @TableField(exist = false)
    private Set<TopCentralProductType> productTypes;
}
